package mapper;

import BO.WorkTest2BO;
import DO.WorkFileUploadDO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface WorkFileUploadMapper {
    // 保存测试信息
    @Insert("insert into work_file_upload (work_id, `order`, score, description, create_time) VALUES (#{workId},#{order},#{score},#{description},#{createTime})")
    void save(WorkFileUploadDO workFileUploadDO);

    // 获取题目数据
    @Select("select score, description from work_file_upload where work_id = #{workId} order by `order`")
    List<WorkTest2BO> getById(Integer workId);

    @Select("select score from work_file_upload where work_id = #{workId} order by `order`")
    List<Double> getScoreByWorkId(Integer workId);

    @Select("select description from work_file_upload where work_id = #{workId} order by `order`")
    List<String> getQuestionByWorkId(Integer workId);
}
